/**
 * Created by Amaris on 2016/12/6.
 */

var express = require('express');
var router = express.Router();
var userCtrl = require('../../controller/controller.user.js');

router.get('/getUserInfo', function (req, res, next) {
    userCtrl.getInfo(req.query, function (err, result) {
        if (err) throw err;
        res.send(result);
    });
});

router.post('/createUser', function (req, res, next) {
    userCtrl.create(req.body, function (err, result) {
        if (err) throw err;
        res.send(result);
    });
});
router.post('/updateUser', function (req, res, next) {
    userCtrl.update(req.body, function (err, result) {
        if (err) throw err;
        res.send(result);
    });
});

router.get('/getUserList', function (req, res, next) {
    userCtrl.getList(req.query, function (err, result) {
        if (err) throw err;
        res.send(result);
    });
});

module.exports = router;